home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3723 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: TMapping again!
  5. Date: 23 Feb 1996 16:55:25 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Distribution: world
  8. Message-ID: <4gkrht$d5l@maureen.teleport.com>
  9. References: <4fq6m6$gah@maureen.teleport.com> <38232456@kone.fipnet.fi> <4g7t86$em3@maureen.teleport.com> <38232527@kone.fipnet.fi>
  10. NNTP-Posting-Host: julie.teleport.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Jyrki Saarinen (jsaarinen@kone.fipnet.fi) wrote:
  14.  
  15. : > : Hmm. I have 15 long divides per polygon. (Texture/Gouraud)
  16. : > : Now if they take about 30 cycles, only ~15 pixels have to be
  17. : > : drawn to take the same amount of cycles. Therefore I dont
  18. : > : use a divide table now..
  19. : > 
  20. : >  My guess is that you draw only a few polygon per frame...
  21. : >  But 15 pixels , ~450 cycles really addup when you draw alot of
  22. : >  polygon. If you draw 100 triangle at 60fps and your not using a
  23. : >  512 byte divtable then your rendering code will take 10% more CPU
  24. :    ^^^^^^^^^^^^^^^^^
  25. : >  2700000 cycles extra ... Yep, it addup quick :)
  26.  
  27. : I dont think that is really enough ... besides, you must use
  28. : muls for 1/x table because the divided value can be negative, too.
  29. : So 16.16 not possible, only 15b of fraction.
  30.  
  31. : Please explain your calculations a little..
  32.  
  33.  a mul?.w is 27, a muls.l is 43
  34.  a divs.l is 90
  35.  
  36. -- what you do with muls.l is:
  37.  
  38. setup
  39.         move.l  (a2,d0.w*4),d1  ;done upto 4 time per poly
  40.  
  41. opp:
  42.     ext.l    d2
  43.         muls.l  d1,d2         ; 2+43 * upto 15time = 675
  44.  
  45.  
  46. -- with div:
  47.  
  48. setup
  49.         ext.l   d0        ; done upto 4 time per poly
  50.  
  51. opp:
  52.         swap    d2
  53.         sub.w   d2,d2
  54.     divs.l    d2,d0         ;4+2+90 * 15 = 1440
  55.  
  56.  now, (1440+8-675-28) * 60 * 100 = 4.47 mcycle.
  57.  
  58.  You dont have to fall back to 15bit precision to gain the speed
  59.  from mul VS div... using 15bit give you an extra 6.03 mcycle, or
  60.  you could use mulu.w and adjust the sign?
  61.  
  62.  Myself I will stick with 16:16 and muls.l on 68030 and under.
  63.  a divs.l is ~2time slower then a muls.l and ~3.5 slower then a muls.w
  64.  On a 68000 I would go with 15bit and muls + an add.l: 76 cycle... ouch ,
  65.  but still less then a divs.l on a 030 ;) (To bad the 68000 mhz is so
  66.  limited:)
  67.  
  68.  Stephan
  69.